import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/scm/order/page',
    method: 'get',
    params: query
  })
}
export function page1(query) {
  return request({
    url: '/scm/order/page1',
    method: 'get',
    params: query
  })
}
export function getdetailInfor(id) {
  return request({
    url: `/scm/order/${id}`,
    method: 'get'

  })
}
export function change(data) {
  return request({
    url: '/scm/order/change',
    method: 'put',
    data
  })
}
export function detail(id) {
  return request({
    url: `/scm/order/${id}`,
    method: 'get'

  })
}
export function detailChange(data) {
  return request({
    url: `/scm/order/detail/change`,
    method: 'put',
    data: data
  })
}
export function sendList(id, data) {
  return request({
    url: `/scm/order/sendMsg/${id}`,
    method: 'get',
    params: data
  })
}
export function updateOrderShipped(companyId, data) {
  return request({
    url: `/scm/supplier/order/updateOrderShipped/${companyId}`,
    method: 'put',
    data
  })
}

export function discuss(companyId, data) {
  return request({
    url: `/scm/order/discuss/${companyId}`,
    method: 'post',
    data: data
  })
}
// export function  getdiscuss(companyId,data){
//    return request({
//     url: `/scm/supplier/order/discuss/${companyId}`,
//     method: 'get',
//     params:data
//   })
// }
export function getdiscuss(companyId, obj) {
  return request({
    url: `/scm/order/discuss/${companyId}`,
    method: 'get',
    params: obj
  })
}
export function getEditList(companyId, data) {
  return request({
    url: `/scm/supplier/order/getEditList/${companyId}`,
    method: 'get',
    params: data
  })
}
export function download() {
  return request({
    url: `/scm/order/downloadordermode/`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function batchConfirm(data) {
  return request({
    url: `/scm/order/allsure`,
    method: 'put',
    data: data
  })
}
export function downLoadContarctFile(id, type) {
  return request({
    url: `/scm/order/download/ordercontract/${id}/${type}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function delContarctFile(scmOrderId) {
  return request({
    url: `/scm/order/ordercontract/${scmOrderId}`,
    method: 'delete'

  })
}
export function getOrderDetailUploadFile(scmOrderDetailId) {
  return request({
    url: `/scm/order/getFileInfo/${scmOrderDetailId}`,
    method: 'get'

  })
}
export function downloadPing(id) {
  return request({
    url: `/scm/order/downloadOrderDetailFile/${id}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function warehouseStatus(data) {
  return request({
    url: `/scm/order/warehouseStatus/change`,
    method: 'put',
    data
  })
}

export function savenote(data) {
  return request({
    url: `/scm/order/warehouseStatus/note`,
    method: 'put',
    data
  })
}
export function downAll(data) {
  return request({
    url: `/scm/order/doExport`,
    responseType: 'arraybuffer',
    method: 'get',
    params: data
  })
}
// 上传入库数据
export function rukuFile(file) {
  return request({
    url: '/scm/order/orderInStoreDetail/excelImport',
    method: 'post',
    data: file
  })
}
export function rukuFileList(data) {
  return request({
    url: '/scm/order/orderInStoreDetail/query',
    method: 'get',
    params: data
  })
}
export function overseaOrder(file) {
  return request({
    url: '/scm/order/overseaOrder/excelImport',
    method: 'post',
    data: file
  })
}

export function getInfooverseaOrder(query) {
  return request({
    url: '/scm/order/overseaOrder/query',
    method: 'get',
    params: query
  })
}
export function rukudetail(query) {
  return request({
    url: '/scm/order/orderInStoreDetail/queryByDetailId',
    method: 'get',
    params: query
  })
}
export function deleteAll() {
  return request({
    url: '/scm/order/overseaOrder/delete',
    method: 'delete'

  })
}
export function detailDel(query) {
  return request({
    url: '/scm/order/detail/del',
    method: 'delete',
    params: query
  })
}
export function getListByDetailId(data) {
  return request({
    url: `/scm/supplier/order/getListByDetailId`,
    method: 'get',
    params: data
  })
}
export function getSendDetailMessage(data) {
  return request({
    url: `/scm/supplier/order/getSendDetailMessage`,
    method: 'get',
    params: data
  })
}
